package com.rpc.netty.httpNetty;



import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;
/**
 * @author 何章怀晓 hezhanghuaixiao
 * @version V1.0
 * @desc
 */
public class HttpServerInit extends ChannelInitializer<SocketChannel> {

  @Override
  protected void initChannel(SocketChannel ch) throws Exception {

    //向管道添加处理器
    ChannelPipeline pipeline = ch.pipeline();
    //加入处理器
    pipeline
        .addLast("NettyHttpHandler", new HttpServerCodec())
        .addLast("HttpServerHandler", new HTTPServerHandler());

  }
}
